<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>
<%
 String path = request.getContextPath();
 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 String ua = request.getHeader("User-Agent");
 response.setHeader("aaaaa","asdfsadfsasfsfd");
  
     
     Connection conn = null;
     PreparedStatement pst = null;
     ResultSet rs = null;
     java.util.Date d  = null;
     String brandInfo  = "";
     int retCode  = 0;
    try{
	 //连接数据库
	 String drive = "com.mysql.jdbc.Driver";
	 String url = "jdbc:mysql://127.0.0.1:3306/ecp";
	 Class.forName(drive);
	 DriverManager.setLoginTimeout(3);
	 conn = DriverManager.getConnection(url,"root","qweasd");	
     pst = conn.prepareStatement("  SELECT t.id,t.appname,t.downnum,t.appid,t.filename FROM  t_appdown_num t ");
    
     rs = pst.executeQuery();
%>



<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
	content="application/vnd.wap.xhtml+xml;charset=UTF-8" />

<title>移动应用下载中心</title>
<style type="text/css">
 
  #mytable {   
     padding: 0;
     margin: 0;   
     border-collapse:collapse;
 }

 th {
     border: 1px solid #C1DAD7;   
     background: #99CCFF;
     font-size:13px;
     padding: 6px 6px 6px 12px;
     color: #4f6b72;
 }
 
 td {
     border: 1px solid #C1DAD7;   
     background: #fff;
     font-size:11px;
     padding: 6px 6px 6px 12px;
     color: #4f6b72;
 }

 td.alt {
     background: #F5FAFA;
     color: #797268;
 }
 

</style>
</head>

<body>

	<div class="content">
    <table id="mytable" border="0" width="500">
      <thead>
         <tr>
            <th >id</th>
            <th>APP名称</th>
            <th>下载次数</th>
            <th>APP编码（下载用）</th>
            <th>APP文件名</th>
         </tr>
      </thead>
        <%   
     while(rs.next()){
         int id = rs.getInt("id");
         String appName = rs.getString("appname"); 
         int dnum = rs.getInt("downnum");
         int appid = rs.getInt("appid");
         String filename = rs.getString("filename"); 
         %>
	 
			<tr>
				<td ><%=id %></td>
				<td ><%=appName %></td>
				<td ><%=dnum %></td>
				<td ><%=appid %></td>
				<td ><%=filename %></td>
			</tr>
			      
<%     }
    }catch(Exception e){
         
    }finally{
      rs.close();
      pst.close();
      conn.close();
    } %>
	 </table>
  </div>

</body>
</html>